package top.ljlgithub.api.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import top.ljlgithub.api.bean.Express;
import top.ljlgithub.api.common.response.Meta;
import top.ljlgithub.api.common.response.ResponseEntity;
import top.ljlgithub.api.service.ExpressService;

import java.util.List;

/**
 * @ClassName
 * @Description TODO
 * @Author L1470
 * @Date 2021/5/7 19:15
 * @Version 1.0
 **/
@CrossOrigin
@RestController
public class ExpressController {
    @Autowired
    ExpressService expressService;

    @GetMapping("/express/{id}")
    public ResponseEntity getExpress(@PathVariable("id") Integer id){
        Meta meta = new Meta("获取物流信息成功", 200);
        List<Express> express = expressService.getExpress(id);
        ResponseEntity<Object> result = new ResponseEntity<>(express,meta);
        return result;
    }
}